<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

</body>
</html>
<script>
    arr=[100,[{a:'hello'},{b:'world'}],{c:'12345'}]
    function clone (obj={}){
        if (typeof obj !== 'object'|| obj == null){
            return obj
        }
        let result
        obj instanceof Array?result=[]:result={}
        for (var item in obj){
            if(obj.hasOwnProperty(item)){
                result[item]=clone(obj[item])
            }
        }
        return result
    }
    let arr1 = clone(arr)
    arr1[1][0].a='vue'
    arr1[0]=99
    console.log('原数组'+arr);
    console.log('新数组'+arr1);
</script>